#ifndef BSP_USART_H
#define BSP_USART_H

#include "stm32f10x.h"
#include <stdbool.h>

#define USE_USART1_DMA_TX	1
#define USE_USART1_DMA_RX	1

#define USE_USART2_DMA_TX	0
#define USE_USART2_DMA_RX	1

#define USE_USART3_DMA_TX	1
#define USE_USART3_DMA_RX	1

#define USART3_RX_BUFFER_SIZE	200
#define USART3_TX_BUFFER_SIZE 200

#define USART2_TX_BUFFER_SIZE 100
#define USART2_RX_BUFFER_SIZE 2048

#define USART1_TX_BUFFER_SIZE 100
#define USART1_RX_BUFFER_SIZE 100

void bspUsart1Init(u32 baudrate);

void bspUsart1Send(const char* str, u32 size);

u32  bspUsart1Receive(void** buffer);

bool  bspUsart1Available(void);

void bspUsart2Init(u32 baudrate);

void bspUsart2Send(const char* str, u32 size);

u32  bspUsart2Receive(void** buffer);

bool  bspUsart2Available(void);

void bspUsart3Init(u32 baudrate);

void bspUsart3Send(const char* str, u32 size);

u32  bspUsart3Receive(void** buffer);

bool  bspUsart3Available(void);

void bspUsart3CleanData(void);

void bspUsart2CleanData(void);
#endif
